package com.meko.tms.core.log.entity;


import java.util.Date;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * 
 * 
 * @author meko
 * @date 2019-09-26
 */
@Data
@Accessors(chain = true)
@NoArgsConstructor
public class Log {


    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 描述
     */
    private String description;


    /**
     * 日志类型
     */
    private String logType;

    /**
     * 方法名
     */

    private String method;

    /**
     * 访问IP
     */

    private String requestIp;

    /**
     * 方法运行时间
     */

    private Long time;

    /**
     * 用户名
     */

    private String username;

    /**
     * 姓名
     */

    private String empName;

    /**
     * 访问地址
     */

    private String address;

    /**
     * 异常细节
     */

    private byte[] exceptionDetail;

    /**
     * 参数
     */

    private String params;

    public static final String ID = "id";

    public static final String DB_ID = "id";

    public static final String CREATE_TIME = "createTime";

    public static final String DB_CREATE_TIME = "create_time";

    public static final String DESCRIPTION = "description";

    public static final String DB_DESCRIPTION = "description";

    public static final String LOG_TYPE = "logType";

    public static final String DB_LOG_TYPE = "log_type";

    public static final String METHOD = "method";

    public static final String DB_METHOD = "method";

    public static final String REQUEST_IP = "requestIp";

    public static final String DB_REQUEST_IP = "request_ip";

    public static final String TIME = "time";

    public static final String DB_TIME = "time";

    public static final String USERNAME = "username";

    public static final String DB_USERNAME = "username";

    public static final String EMP_NAME = "empName";

    public static final String DB_EMP_NAME = "emp_name";

    public static final String ADDRESS = "address";

    public static final String DB_ADDRESS = "address";

    public static final String EXCEPTION_DETAIL = "exceptionDetail";

    public static final String DB_EXCEPTION_DETAIL = "exception_detail";

    public static final String PARAMS = "params";

    public static final String DB_PARAMS = "params";

    public static Log defaultInstance() {
        Log instance = new Log();
        return instance;
    }


    public Log(String logType, Long time) {
        this.logType = logType;
        this.time = time;
    }
}